package com.zhao.factoryMethod.creater;

import com.zhao.factoryMethod.factory.impl.CatFactory;
import com.zhao.factoryMethod.factory.impl.DogFactory;
import com.zhao.factoryMethod.pojo.Animal;
import lombok.extern.slf4j.Slf4j;

//上帝创造猫和狗
@Slf4j
public class God {
    public void create() {
        Animal cat = new CatFactory().createAnimal();
        Animal dog = new DogFactory().createAnimal();

        cat.sleep();
        dog.eat("米饭");
    }
}
